﻿using System;
using EFDataModel;

namespace ContactMvc4TB.Models.Worktime.Helpers
{
    /// <summary>
    /// Properties für die Listendarstellung der Arbeitszeiteinträge.
    /// </summary>
    public class ListEntry
    {
        /// <summary>
        /// Berechnet einfach aus der Startzeit die passenden Minuten
        /// </summary>
        public double StartTimeInMinutes
        {
            get
            {
                TimeSpan span = new TimeSpan(0, StartTime.Hour, StartTime.Minute, 0);
                return span.TotalMinutes;
            }
        }

        /// <summary>
        /// Berechnet einfach aus der Endzeit die passenden Minuten
        /// </summary>
        public double EndTimeInMinutes
        {
            get
            {
                TimeSpan span = new TimeSpan(0, EndTime.Hour, EndTime.Minute, 0);
                return span.TotalMinutes;
            }
        }

        public DateTime CurrentDate { get; set; }

        public DateTime StartTime { get; set; }

        public DateTime EndTime { get; set; }

        public string Description { get; set; }

        public string Notice { get; set; }

        public bool IsManualOverTime { get; set; }

        public int ManualOvertimeInMinutes { get; set; }

        public EWorktimeType WorktimeType { get; set; }

        public long WorktimeId { get; set; }

        public long UserId { get; set; }

        public bool HasProject { get; set; }

        public string ProjectName { get; set; }

        public int Duration { get; set; }
    }
}